home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / sc3x04.exe / CLRCONN.C < prev    next >
C/C++ Source or Header  |  1993-08-06  |  3KB  |  62 lines

  1. //   ╔════════════════════════════════════════════════════════════════════╗
  2. //   ║                                                                    ║
  3. //   ║ module:      clrconn.c                                             ║
  4. //   ║ abstract:    This module shows how to make 3.x system calls using  ║
  5. //   ║              the F2 Shell Interface.  Obviously, it requires the   ║
  6. //   ║              NetWare Shell.                                        ║
  7. //   ║                                                                    ║
  8. //   ║ environment: NetWare 3.x v3.11                                     ║
  9. //   ║              Borland C++ 3.1                                       ║
  10. //   ║                                                                    ║
  11. //   ║  This software is provided as is and carries no warranty           ║
  12. //   ║  whatsoever.  Novell disclaims and excludes any and all implied    ║
  13. //   ║  warranties of merchantability, title and fitness for a particular ║
  14. //   ║  purpose.  Novell does not warrant that the software will satisfy  ║
  15. //   ║  your requirements or that the software is without defect or error ║
  16. //   ║  or that operation of the software will be uninterrupted.  You are ║
  17. //   ║  using the software at your risk.  The software is not a product   ║
  18. //   ║  of Novell, Inc. or any of subsidiaries.                           ║
  19. //   ║                                                                    ║
  20. //   ║      ****    NOTICE    ****    NOTICE   ****   NOTICE   ****       ║
  21. //   ║                                                                    ║
  22. //   ║  This example code has not been extensively tested and therefore   ║
  23. //   ║  should be run on a test server before used in a production en-    ║
  24. //   ║  vironment.  Also, a backup is recommended before the installation ║
  25. //   ║  of any untested component.                                        ║
  26. //   ║                                                                    ║
  27. //   ╚════════════════════════════════════════════════════════════════════╝
  28.  
  29. #include <dos.h>
  30. #include <stdio.h>
  31. #include <string.h>
  32. #include <stdlib.h>
  33. #include <ctype.h>
  34. #include "nwsys.h"
  35.  
  36. struct {
  37.     int  bufLen;
  38.     char func;
  39.     char connNum;
  40. } Req;
  41.  
  42. main(int argc, char *argv[])
  43. {
  44.     int ccode;
  45.  
  46.     if (argc < 2) {
  47.         printf("Usage: CLRCONN <connection number>\n");
  48.         exit(1);
  49.     }
  50.  
  51.     Req.bufLen = sizeof(Req) - 2;
  52.     Req.func = 0xd2;
  53.     Req.connNum = atoi(argv[1]);
  54.  
  55.     ccode = NWSystemCall(0x17, &Req, sizeof(Req), NULL, 0);
  56.     if (ccode != 0) {
  57.         printf("Clear Connection failed.  Retcode = 0x%x\n", ccode);
  58.         exit(1);
  59.     }
  60.     return(0);
  61. }
  62.